#ifndef CODEC_INFO_H
#define CODEC_INFO_H
#include <string>
#include <vector>
#include <map>

namespace xrtc
{
    class AudioCodecInfo;
    class VideoCodecInfo;

    class FeedbackParam
    {
    public:
        FeedbackParam(const std::string &id, const std::string &param) : id_(id), param_(param) {}
        FeedbackParam(const std::string &id) : id_(id), param_("") {}
        std::string Id() { return id_; }
        std::string Param() { return param_; }

    private:
        std::string id_;
        std::string param_;
    };
    
    typedef std::map<std::string,std::string> CodecParam;

    class CodecInfo
    {
    public:
        virtual AudioCodecInfo *AsAudio() { return nullptr; }
        virtual VideoCodecInfo *AsVideo() { return nullptr; }

    public:
        int id;
        std::string name;
        int clockrate;
        std::vector<FeedbackParam>  feekback_param;
        CodecParam codec_param;
    };

    class AudioCodecInfo : public CodecInfo
    {
    public:
        AudioCodecInfo *AsAudio() override { return this; }

    public:
        int channels;
    };
    class VideoCodecInfo : public CodecInfo
    {
    public:
        VideoCodecInfo *AsVideo() override { return this; }
    };

} // namespace xrtc

#endif // CODEC_INFO_H